<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:p="http://primefaces.org/ui">

<h:head>

</h:head>

<h:body>
	<ui:include src="menu.xhtml" />
	<h:form id="formListaEscritorioRegional" rendered="true">
		<div align="center">
			<h:panelGrid columns="5">

				<h:outputLabel for="txtFiltroCodigoVoo" value="Código Voo" styleClass="createStaticField" />

				<h:inputText id="txtFiltroCodigoVoo" styleClass="inputText" size="10" maxlength="30" value="#{vooMB.vooBeanFiltros.codigoVoo}" />

			</h:panelGrid>
		</div>
		<center>
			<p:commandButton value="Pesquisar" styleClass="button" update="lista" id="listagemBtPesquisar" action="#{vooMB.list}" />
			<p:commandButton styleClass="button" type="reset" value="Limpar" update="@form" id="btLimpar" />
		</center>



		<p:separator style="width:100%" />

		<h:commandLink id="linkIncluirEscritorio" action="createVoo" immediate="true">
			<p:graphicImage height="35px" value="/images/iconAdd.png" title="Incluir Novo">
			</p:graphicImage>
		</h:commandLink>

		<p:dataTable id="lista" var="voo" paginator="true" rows="20" value="#{vooMB.listaVooBean}">

			<p:column style="text-align:center; width: 30%" rendered="true">
				<f:facet name="header">Código Voo</f:facet>
				<h:outputText value="#{voo.codigoVoo}"></h:outputText>
			</p:column>

			<p:column style="text-align:center; width: 30%" rendered="true">
				<f:facet name="header">Origem</f:facet>
				<h:outputText value="#{voo.origemVoo}" />
			</p:column>

			<p:column style="text-align:center; width: 30%" rendered="true">
				<f:facet name="header">Destino</f:facet>
				<h:outputText value="#{voo.destinoVo}" />
			</p:column>

			<p:column style="text-align:center; width: 30%" rendered="true">
				<f:facet name="header">Data Decolagem</f:facet>
				<h:outputText value="#{voo.dataPrevistaDecolagem}">
					<f:convertDateTime dateStyle="medium" />
				</h:outputText>
			</p:column>

			<p:column style="text-align:center; width: 30%" rendered="true">
				<f:facet name="header">Data Pouso</f:facet>
				<h:outputText value="#{voo.dataPrevistaPouso}">
					<f:convertDateTime dateStyle="medium" />
				</h:outputText>
			</p:column>

			<p:column style="text-align:center; width: 5%">
				<p:commandLink id="linkEditarEscritorio">
					<p:graphicImage height="20px" style="border:0;" value="/images/iconeEditar.png" title="Editar" />
				</p:commandLink>

				<p:commandLink id="linkVisualizarEscritorio">
					<p:graphicImage height="20px" style="border:0;" value="/images/iconeVisualizar.png" title="Exibir" />
				</p:commandLink>

				<h:commandLink id="linkExcluirEscritorio" onclick="return confirm('Confirma Exclusão ?');" update="listarEscritorioRegional">
					<p:graphicImage height="20px" style="border:0;" value="/images/iconeLixo.png" title="Excluir" />
				</h:commandLink>
			</p:column>
		</p:dataTable>
	</h:form>
</h:body>
</html>
